package cn.edu.wynu.io;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class ReaderLearn {
    public static void main(String[] args) throws IOException {
        FileReader reader = new FileReader("src/cn/edu/wynu/io/test.txt");
        while(true) {
            int n = reader.read(); // 反复调用read()方法，直到返回-1
            if (n == -1) {
                break;
            }
            System.out.print((char)n); // 打印char
        }
        reader.close();
    }
}
